package com.ruoyi.common.enums;

import com.ruoyi.common.utils.StringUtils;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author: azh
 * Created on 2025-2-25 22:21
 */
public enum InspectionLineType {

    UNKNOWN("未知"),
    HB("合蚌线");

    private String name;

    InspectionLineType(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static InspectionLineType of(String type) {
        return Arrays.stream(InspectionLineType.values())
                .filter(it -> StringUtils.equals(it.name(), type))
                .findFirst()
                .orElse(UNKNOWN);
    }

    public static List<InspectionLineType> list() {
        return Arrays.stream(InspectionLineType.values())
                .filter(it -> !StringUtils.equals(it.name(), UNKNOWN.name()))
                .collect(Collectors.toList());
    }
}
